D71 Ultimate 0.2
Nordlicht 2013 Party Version
by Jasmin68k
--------------------------------------------------------------
- Sincere thanks to Kabuto for finding the 1541 Ultimate II  -
- Command Interface Register API PDF at the party!           -
- http://xp-dev.com/svn/1541UltimateII/trunk/doc/            -
--------------------------------------------------------------

History
-------

A few days ago, I set up my trusty old C128DCR again.
Quickly, the need to write D71 images arose.

I didn't feel like undusting my old Windows XP box running
OpenCBM with an XM1541 cable just for that purpose.

Luckily, I own a 1541 Ultimate II connected to a C64C.

Unfortunately, the Ultimate can't mount D71 images, otherwise
a simple disk copier would have sufficed to copy a mounted D71
to a real floppy (which works fine with D64's).

For a few days, I played around with all kinds of tools and ideas,
none of which provided a solution, since the Ultimate's software
IEC - which allows you to directly access files on the SD card -
only provides the basic load/save functions, which are unsuitable
for sector-by-sector access.

Only thing that did work was zip'ping the D71, create a D64 with
the zipped file on it, mount that and use gunzip
www.cs.tut.fi/~albert/Dev/gunzip/ on the C64, which can handle
D71 files.

This only works for D71 images which can be zipped small enough
to fit on a D64 image though.

Searching back and forth, coming up empty handed, it seems that
nobody so far has written a D71 writer, which works in conjunction
with only a C64, a 1571 and an Ultimate.

So I decided to make my own...

It was one day before Nordlicht 2013, when I hacked together the
basic framework using various code snippets I stumbled upon and
got a working prototype.

I still had to manually load the D71 images into the REU at this
point, which needed to be renamed to [filename].reu in order for
the "Load into REU" option to appear and I still had no error
handling etc., but it worked :)

Except for some example code reading the status of Ultimate DOS
from the 1541 Ultimate II Command Interface and the command
summary PDF, I couldn't locate any info on how to actually use the
exposed registers to (in my case) open a file and load it into
the REU.

A "Register API" document was referred to in the "Command summary"
PDF, but I wasn't able to find it using Google for whatever reason.

At the party, to my rescue came Kabuto, who managed to locate it using
Bing search and so I finally got what I needed to make a version capable
of prompting for a filename and load the D71 image directly into the
REU (which has the additional benefit of not having to rename it to
[filename].reu).

So I spent some time at the party getting to know Ultimate DOS and
implemented my REU loader. I also added some error handling etc.

I am aware, that not every 1541 Ultimate (I or II) contains the
only quite recently added Ultimate Command Interface and Ultimate DOS -
depending on firmware version etc.

For users of those, a version of D71 Ultimate which prompts you to
manually load your (renamed!) D71 image file into the REU has been
included.

About
-----

Well, by now you should know, what D71 Ultimate is all about: Write a
D71 image to a real 1571 using a C64, 1571 and 1541 Ultimate.

Usage should be pretty self-explaining, just load the PRG and run it;
either the Ultimate DOS Version (if your Ultimate has Ultimate Command
Interface and Ultimate DOS - don't forget to enable it!) or the
Manual REU Version.

Then just follow instructions...

As it stands right now, D71 Ultimate is a hacked together BASIC/ASM
hybrid, which is pretty dirty in more than one way...but it works ;)

How it works should also be pretty obvious to anyone dissecting the code...

The main short coming of D71 Ultimate at the moment is it's slow...and
I mean it...REALLY SLOW!

It takes a little less than 19 minutes to write the full 70 tracks of one
image.

For now, I provide it as is, should anyone besides me still consider it
useful.

I don't write D71's that often anyway... ;)

Should anyone feel like improving it, go ahead :)

What it needs most of all is a fast save routine, then maybe a fast format
routine (it prompts you to format the target disk in 1571 format before
writing the image).

Of course, one could also move the BASIC framework (format, filename input,
fetching sectors from REU etc.) to ASM, but that most likely won't provide
much benefit (in terms of speed).

Also, D71 Ultimate serves as some nice example code for using the Ultimate
Command Interface and Ultimate DOS, which I haven't seen any of yet, except for
a simple example reading the status codes.

By changing the DATA lines, which contain the sector layout, the hardcoded
(in ASM) file length to read and the format part in BASIC, one can btw
easily convert the tool to write D81's etc. btw. I'll leave that as an exercise
to the determined reader ;)

Well, so here it is...maybe someone besides me finds D71 Ultimate useful and/or
likes to improve it :)

Signing off

Jasmin68k @ Nordlicht 2013
